package demo5;

import demo4.Emp;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class PreTest {

    @Test
    public void test1() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");
        Pre pre = context.getBean("pre", Pre.class);
        System.out.println(pre);

        Pre pre2 = context.getBean("pre", Pre.class);

        // 多实例情况下为false
        System.out.println(pre == pre2);
    }
}
